<!doctype html>
<html><head>

<script type="text/javascript">
	var params = {}, queryString = location.hash.substring(1),
    regex = /([^&=]+)=([^&]*)/g, m;
	while (m = regex.exec(queryString)) {
	  params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
	}

	//console.log(window.opener.oauth2.parent.doOAuthLogin);
	
	if (window.opener != 'null' && window.opener.oauth2 != 'null' && window.opener.doOAuthLogin) {
		// return control to main window by calling a function of that window
		window.opener.doOAuthLogin(params);
		window.opener.oauth2.close();
	} else {
		document.body.innerText = "Your browser seems to be stopping this window from communicating with the main window.";
	}
</script>


</head><body></body>
</html>